<?php
// 连接数据库
$link = mysqli_connect("localhost","root","root","2108");
if(!$link){
    die("连接数据库失败");
}

$sql = "SELECT * FROM `only-details`";
$res = mysqli_query($link,$sql);

$arr=[];
while($row = mysqli_fetch_assoc($res)){
    array_push($arr,$row);
}

echo json_encode($arr);

?>